import { TouchableOpacity } from "react-native";
import { AntDesign } from "@expo/vector-icons";

export default function Reload({board,setBoard,setWrongCells}){
    const handleReload=()=>{
        const newBoard=[...board];
        for(let i=0;i<9;i++){
            for(let j=0;j<9;j++){
                if(!newBoard[i][j].isFixed){
                    newBoard[i][j].value=null;
                    newBoard[i][j].noteValue=[];
                    newBoard[i][j].isError = false;
                }
            }
        }
        setWrongCells([]);
        setBoard(newBoard);
    }
    return(
        <TouchableOpacity onPress={handleReload}>
            <AntDesign name="reload1" size={25} color="black" />
        </TouchableOpacity>
    )
}